package com.liusy.code.bean;


import java.sql.Types;
import java.text.SimpleDateFormat;

import com.liusy.code.DbHelp;

public class ColumnInfo {

	private String nameDb;

	private String nameClassl;
	private String nameClassu;
	private String remark;
	private int type;
	private int length;
	private boolean isKey;
	private boolean isNull;
	
	
	public String getNameClassl() {
		return nameClassl;
	}
	public void setNameClassl(String nameClassl) {
		this.nameClassl = nameClassl;
	}
	public String getNameClassu() {
		return nameClassu;
	}
	public void setNameClassu(String nameClassu) {
		this.nameClassu = nameClassu;
	}
	public boolean isNull() {
		return isNull;
	}
	public void setNull(boolean isNull) {
		this.isNull = isNull;
	}
	public boolean isKey() {
		return isKey;
	}
	public void setKey(boolean isKey) {
		this.isKey = isKey;
	}
	public String getNameDb() {
		return nameDb;
	}
	public void setNameDb(String nameDb) {
		this.nameDb = nameDb;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	public String getJavaType()
	{
		
		   
		   
		 if (type == Types.DATE) {
			 	//SimpleDateFormat format = new SimpleDateFormat(DbHelp.DATE_FORMAT);
			 return "Date";
	      } else if (type == Types.TIMESTAMP) {
	         //SimpleDateFormat format = new SimpleDateFormat(DbHelp.TIMESTAMP_FORMAT);
	    	  return "Date";
	      } else if (type == Types.TIME) {
	    	  SimpleDateFormat format = new SimpleDateFormat(DbHelp.TIME_FORMAT);
	    	  return "Date";
	      } else if (type == Types.INTEGER) {
	        return "int";
	      } else if (type == Types.BIGINT) {
	        return "int";
	      } else if (type == Types.DECIMAL || type == Types.NUMERIC || type == Types.FLOAT) {
	    	  return "int";
	      } else {
	    	  return "String";
	      }
		
	}
	
	
	
}
